home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7410 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: emergency! need help..... please
  5. Date: 23 Feb 1996 05:29:15 GMT
  6. Organization: systems hk
  7. Message-ID: <4gjjbb$mhd@maureen.teleport.com>
  8. References: <4ggqqj$fen@cloner4.netcom.com>
  9. NNTP-Posting-Host: ip-pdx20-13.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. wells2@ix.netcom.com (wells) wrote:
  16. >why doesnt this work???
  17. >
  18. >#include <stdio.h>
  19. >#include <iostream.h>
  20. >#include <math.h>
  21. >
  22. >void main(void)
  23. >{
  24. >    float l;    // loan amount
  25. >    float r;    // interest rate
  26. >    int n;        // number of payments
  27. >    float p;    // payment
  28. >    float a,b,c,d;
  29. >    cout << "Enter the full loan amount ->";
  30. >    cin >> l;
  31. >    cout << "\n Enter the interest rate ->";
  32. >    cin >> r;
  33. >    cout << "\n Enter the number of payments ->";
  34. >    cin >> n;
  35. >    r=r/1200;    
  36. >    a=(l+r);
  37. >    b=pow(a,n)*r;
  38. >    c=(l+r);
  39. >    d=pow(c,n)-1;
  40. >    p=((b/d)*l);
  41. >    cout << p;
  42. >    }
  43. >
  44. Hi,
  45. It looks like to me that your '(1+r)' quantities actually contain
  46. 'l' (ELL) rather than '1' (ONE).  Should it not be the (rate + one)?
  47. Yours, Geoff Houck
  48.  
  49.